class FriendshipController < ApplicationController
  before_filter :confirm_logged_in

  def create
    user = User.find_by_id params[:id]
    if current_user.request_friendship user
      render :json => true
    else
      render :json => false
    end
  end

  def destroy
    user = User.find_by_id params[:id]
    if current_user.friends.delete user
      render :json => true
    else
      render :json => false
    end
  end

end
